<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jspf"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
    <title>main1.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<style type="text/css">
td span:hover{color: red; text-decoration: underline;}
</style>
<link rel="stylesheet" type="text/css" href="${proPath }/css/bootstrap.min.css">
<!--[if lt IE 9]>
  <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="${proPath }/js/jquery.min.js"></script>
<script type="text/javascript" src="${proPath }/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${proPath }/js/bootstrap-treeview.js"></script>
<script type="text/javascript" src="${proPath }/js/jquery-form.js"></script>
<script type="text/javascript" src="${proPath }/js/bootbox.js"></script>
</head>
<body>

<div class="row">
	<ol class="breadcrumb">
		<c:forEach items="${breadcrumbList}" varStatus="fileManagerItems">  
		       <li lid="${breadcrumbList[fn:length(breadcrumbList) - 1 - fileManagerItems.index].id}" 
		           parentId="${breadcrumbList[fn:length(breadcrumbList) - 1 - fileManagerItems.index].parentId}"
		           parentStrCn="${breadcrumbList[fn:length(breadcrumbList) - 1 - fileManagerItems.index].parentStrCn}"
		           level="${breadcrumbList[fn:length(breadcrumbList) - 1 - fileManagerItems.index].level}"
		           fileName="${breadcrumbList[fn:length(breadcrumbList) - 1 - fileManagerItems.index].fileName}"
		           >
		       		<a href="${proPath }/fileManagerController/getFileManagerListByParentId?parentId=${breadcrumbList[fn:length(breadcrumbList) - 1 - fileManagerItems.index].id}">${breadcrumbList[fn:length(breadcrumbList) - 1 - fileManagerItems.index].fileName}</a>
		       </li>
		</c:forEach> 
	</ol>
</div>
<div class="row">
	<c:if test="${sessionScope.SYS_USER.userType == 0}">
		<button type="button" class="btn btn-primary btn-md"  data-toggle="modal" data-target="" onclick="addNewFolder()">新建文件夹</button>
		<button type="button" class="btn btn-primary btn-md"  data-toggle="modal" data-target="" onclick="fileUpload()">上传文件</button>
	</c:if>
</div>
<div class="row">
	<div class="table-responsive col-xs-12 col-sm-12">
		<table class="table table-bordered table-striped table-hover" id="table">
			<thead>
				<tr>
					<th>类型</th>
					<th>名称</th>
					<th>版本</th>
					<th>物料编码</th>
					<th>系统类型</th>
					<th>产品类型</th>
					<th>产品型号</th>
					<th>使用场景</th>
					<th>产品名称</th>
					<th>特殊单编号</th>
					<th>上传人员</th>
					<th>文档类型</th>
					<th>修改时间</th>
					<th>大小</th>
					<th>下载次数</th>
					<th>备注</th>
					<th>操作</th>
					<th>QR码</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="fileManager" items="${pageModel.list }">
					<tr id="${fileManager.id }" pid="${fileManager.parentId}" fileType="${fileManager.fileType}"  fileName="${fileManager.fileName}" timagePath="${fileManager.imagePath.imageUrl }">
						<th>
							<c:if test="${fileManager.fileType==0 }">
								<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
							</c:if>
							<c:if test="${fileManager.fileType==1 }">
								<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
							</c:if>
						</th>
						<th>${fileManager.fileName }</th>
						<th>${fileManager.version }</th>
						<th>${fileManager.materiel }</th>
						<th>${fileManager.sysType }</th>
						<th>${fileManager.productType }</th>
						<th>${fileManager.productModel }</th>
						<th>${fileManager.usageScenarios }</th>
						<th>${fileManager.productName }</th>
						<th>${fileManager.specialNum}</th>
						<th>${fileManager.uploadUser }</th>
						<th>${fileManager.documentType }</th>
						<th><fmt:formatDate value="${fileManager.updateDate}" pattern="yyyy-MM-dd HH:mm:ss" /></th>
						<th>${fileManager.fileSize}MB</th>
						<th>${fileManager.downloadCount }</th>
						<th>${fileManager.remarks }</th>
						
						<!-- 操作 -->
						<c:if test="${SYS_USER !=null && SYS_USER.userType==0 }">
							<td>
								<span onclick="del(this)">删除</span>
								<span onclick="update(this)">修改</span>
								<span onclick="download(this)">下载</span>
							</td>
						</c:if>
						<c:if test="${SYS_USER !=null && SYS_USER.userType!=0 }">
							<td>
								<span onclick="download(this)">下载</span>
							</td>
						</c:if>
						<!-- qr码 -->
						<c:if test="${fileManager.fileType==0 }">
							<td><span class="glyphicon glyphicon-qrcode" aria-hidden="true" onclick="ShowImage(this)"></span></td>
						</c:if>
						<c:if test="${fileManager.fileType!=0 }">
							<td><span></span></td>
						</c:if>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
		<nav aria-label="Page navigation">
			<ul class="pagination">
				<c:if test="${pageModel.pageNo == 1}">
					<li class="disabled"><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.topPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}" aria-label="Previous"><span aria-hidden="true">首页</span></a></li>
					<li class="disabled"><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.previousPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}">上一页</a></li>
				</c:if>
				<c:if test="${pageModel.pageNo >=2}">
					<li><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.topPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}" aria-label="Previous"><span aria-hidden="true">首页</span></a></li>
					<li><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.previousPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}">上一页</a></li>
				</c:if>
				<li><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.pageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}">${pageModel.pageNo }</a></li>
				<c:if test="${pageModel.pageNo < pageModel.bottomPageNo}">
					<li><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.nextPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}">下一页</a></li>
					<li><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.bottomPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}" aria-label="Next"><span aria-hidden="true">末页</span></a></li>
				</c:if>
				<c:if test="${pageModel.pageNo >= pageModel.bottomPageNo}">
					<li  class="disabled"><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.nextPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}">下一页</a></li>
					<li  class="disabled"><a href="${proPath}/fileManagerController/getFileManagerListByParentId?parentId=${pageModel.list[0].parentId}&pageNo=${pageModel.bottomPageNo }&fileName=${param.fileName}&materiel=${param.materiel}&sysType=${param.sysType}&productType=${param.productType}" aria-label="Next"><span aria-hidden="true">末页</span></a></li>
				</c:if>
			</ul>
		</nav>
	</div>
</body>

</html>
